
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @author: guojianbo
* @since: 2022-04-23 12:45:29
*/
var log_1 = __webpack_require__(/*! ../utils/log */ "./src/core/utils/log.ts");
var analytics_1 = __webpack_require__(/*! _util/analytics */ "./src/core/utils/analytics.ts");
var localData_1 = __webpack_require__(/*! _util/localData */ "./src/core/utils/localData.ts");
var ActiveReport = /** @class */ (function () {
    function ActiveReport() {
    }
    ActiveReport.prototype.reportActive = function (type) {
        try {
            if (!type || "" === 'WEB_WORKER') {
                return;
            }
            var localDate = localData_1.default.get(type === 'init' ? 'report_active_init' : 'report_active_connect') || '';
            var dateObject = new Date();
            var currentDate = dateObject.getFullYear() + "" + (dateObject.getMonth() + 1) + "" + dateObject.getDate() + "" + "4.22.144" + "";
            var debugInfo = 'ActiveReport::reportActive type:' + type + ' localDate:' + localDate + ' currentDate:' + currentDate;
            log_1.default.info(debugInfo);
            if (currentDate !== '' && localDate !== currentDate) {
                var data = {};
                if (type === 'init') {
                    data = {
                        init: 0,
                        msg: debugInfo,
                    };
                }
                else if (type === 'connect') {
                    data = {
                        connect: 0,
                        msg: debugInfo,
                    };
                }
                else {
                    return;
                }
                var reportData = {
                    nm: 'active',
                    val: data,
                };
                analytics_1.default.report(reportData);
                localData_1.default.set(type === 'init' ? 'report_active_init' : 'report_active_connect', currentDate);
            }
        }
        catch (error) {
            log_1.default.error('ActiveReport::reportActive error info:' + error);
        }
    };
    return ActiveReport;
}());
exports.default = new ActiveReport();


//# sourceURL=webpack://MTDX/./src/core/statistics/active-report.ts?